Functions linked to states
How Functions are treated
The figure below shows how functions (that are state dependent) are treated.
run function |
- Initializes exceptions on new state M1_CmdState <> M1_ReqState and on errors set in M1_StatusWord - Goes to exit function when an exception occurs - Acknowledges running - Performs all actions needed for the function until the function call command is reset |
stop function |
- Performs all actions to properly leave this function - Acknowledges end of exit, by setting M1_AckState to M1_ReqState - Returns to last state |
How to add a new function
To add a new function, do as follows:
- copy a similar existing function sequence
- replace the old function name by the new one (e.g. 'Running' by 'MyFunction')
- modify the exit section of the new function to perform the relevant actions
- insert the needed function code into the run part
- add the function call command line to the state sequence where the function is used